home *** CD-ROM | disk | FTP | other *** search
- Path: news.wyoming.com!usenet
- From: dcromley@wyoming.com (Dave Cromley)
- Newsgroups: comp.lang.c++
- Subject: Re: sizeof class
- Date: 27 Feb 1996 18:21:48 GMT
- Organization: wyoming.com LLC
- Message-ID: <4gvi3s$53a@horn.wyoming.com>
- References: <Pine.SOL.3.91.960226185535.3663A-100000@turing.uncg.edu>
- NNTP-Posting-Host: cys-cap-6.wyoming.com
- Mime-Version: 1.0
- X-Newsreader: WinVN 0.99.2
-
- Bin . Lee wrote:
- >class TestClass {};
- >sizeof TestClass is 1 for BC++, is this normal ?
- >Where dose computer store this pointer ?
-
- Yes, it is 1, isn't it?
- I would have thought the size would be 0.
- There is no pointer.
-
- class TestClass2 { int i1; };
- has a sizeof 2--the size of the int.
- struct TestStruct { };
- has a sizeof 1--I would have expected 0.
-
- Dave C.
-
-